FILE(GLOB SRC *.cpp *.h)
FILE(GLOB HEADERS ../../include/nel/web/*.h)

SOURCE_GROUP("" FILES ${SRC} ${HEADERS})

NL_TARGET_LIB(nelweb ${HEADERS} ${SRC})

INCLUDE_DIRECTORIES(../../3rdparty)
INCLUDE_DIRECTORIES(${LIBXML2_INCLUDE_DIR} ${CURL_INCLUDE_DIRS} ${OPENSSL_INCLUDE_DIR})

TARGET_LINK_LIBRARIES(nelweb ${LIBXML2_LIBRARIES} ${CURL_LIBRARIES} ${OPENSSL_LIBRARIES} nelmisc nel_sevenzip)

NL_DEFAULT_PROPS(nelweb "NeL, Library: NeL Web")
NL_ADD_RUNTIME_FLAGS(nelweb)

NL_ADD_LIB_SUFFIX(nelweb)

ADD_DEFINITIONS(${LIBXML2_DEFINITIONS} ${CURL_DEFINITIONS})

IF(WITH_PCH)
  ADD_NATIVE_PRECOMPILED_HEADER(nelweb ${CMAKE_CURRENT_SOURCE_DIR}/stdweb.h ${CMAKE_CURRENT_SOURCE_DIR}/stdweb.cpp)
ENDIF()

NL_GEN_PC(nel-web.pc)

IF((WITH_INSTALL_LIBRARIES AND WITH_STATIC) OR NOT WITH_STATIC)
  INSTALL(TARGETS nelweb LIBRARY DESTINATION ${NL_LIB_PREFIX} ARCHIVE DESTINATION ${NL_LIB_PREFIX} COMPONENT libraries)
ENDIF()
